"""
author：wang tian cheng
date: 2020/11/3
project: ldj
"""
import subprocess
for i in range(256):
    try:
        ret=subprocess.run(["ping","-c","1",f"192.168.0.{i}"],shell="True")
        if ret.returncode == 0:
            print(f"192.168.0.{i}", "这地址正在使用")
        else:
            print(f"192.168.0.{i}","这地址没有使用")
    finally:
        print("")